snapshot: Work on pushing and popping again
authorBenjamin Otte <otte@redhat.com>
Tue, 13 Dec 2016 08:40:24 +0000 (09:40 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 20 Dec 2016 17:01:10 +0000 (18:01 +0100)
commit1137483d156a9062a746b07a6958a4057c115f6c
tree3a6fa6dba1c79ee4f98b8993bb871faaa005cda2
parent1f988d8b050b039f031122e906b0abb72f227cac
snapshot: Work on pushing and popping again

It is now possible to call push() subfunctions for simple container
nodes with just a single child. So you can for example
gtk_snapshot_push_clip() a clip region that all the nodes that get
appended later will then obey.

gtk_snapshot_pop() will then not return a container node, but a clip
node containing the container node (and similar for the transform
example).

This is implemented internally by providing a "collect function" when
pushing that is called when popping to collects all the accumulated
nodes and combine them into the single node that gets returned.

To simplify things even more, gtk_snapshot_pop_and_append() has been
added, which pops the currently pushed node and appends it to the
parent.

The icon rendering code has been converted to this approach.
docs/reference/gtk/gtk4-sections.txt
gtk/gtkrendericon.c
gtk/gtksnapshot.c
gtk/gtksnapshot.h
gtk/gtksnapshotprivate.h